-- camp_ability_up
-- create by huanghr
-- 添加己方战力，根据天空勋章（阵营类加成）

return {
    apply = function(source, target, skillId, round, para, value)
        -- 回复己方战力的N%血量
        local add = tonumber(source:queryAttrib(para[2]));

        local hp = math.modf(source:queryAttrib("hp") * add / 1000);

        -- 回复值不够
        if hp <= 0 then
            return;
        end

        source:addAttrib("hp", hp);

        trace("camp_ability_up", "%s 回复 %d 点生命，当前生命值 %d", source:getName(), hp, source:queryAttrib("hp"));
        return { ["damage"] = 0, ["cure"] = hp, };
    end,

    parse = function(desc)
        local arr = string.explode(desc, ",");
        return {arr[1], arr[2], };
    end,

    getDetail = function(para)
        return desc;
    end,

    parseDesc = function(desc, para)
        return desc;
    end,
};
